class Solution {
public:
    vector<vector<int>> ret;
    vector<int> path;
    int n;
    vector<vector<int>> combine(int n1, int k) {
        n=n1;
        dfs(1,k);
        return ret;
    }

    void dfs(int begin,int k)
    {
        if(k==path.size())
        {
            ret.push_back(path);
            return;
        }
        for(int i=begin;i<=n;i++)
        {
            path.push_back(i);
            dfs(i+1,k);
            path.pop_back();
        }
    }
};